﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    //1、音乐老师（既是老师，又是游泳运动员，又是作家），需要有一种结构，音乐老师继承老师，同时继承运动员。
    //程序员（既是员工，又是作家），需要有一种结构，程序员继承员工，同时继承作家。
    class Person
    {
        private string sex;
        private string name;

        public string Sex { get => sex; set => sex = value; }
        public string Name { get => name; set => name = value; }
        public Person(string sex, string name)
        {
            this.sex = sex;
            this.name = name;
        }
        public Person()
        {
        }
        
    }
    interface IWrite
    {
        void Write();
    }
    interface ITeacher
    {
        void Teach();
    }
    interface ISwim
    {
        void Swim();
    }
    interface IStaff
    {
        void Staff();
    }
    class Teacher:Person,ISwim,IWrite,ITeacher
    {
        public void Swim()
        {
            Console.WriteLine("我会游泳");
        }
        public void Write()
        {
            Console.WriteLine("我会写偷学大作");
        }
        public void Teach()
        {
            Console.WriteLine("我会教人搞人心态");
        }
        public void Watch()
        {
            Console.WriteLine("性别为{0}的{1}正在看着电脑偷学", this.Sex, this.Name);
        }
        public void Sleep()
        {
            Console.WriteLine("性别为{0}的{1}正在床上等死！", this.Sex, this.Name);
        }
        public Teacher(string sex,string name) : base(sex,name)
        {

        }
    }
    class Programmer : Person, IWrite, IStaff
    {
        public void Write()
        {
            Console.WriteLine("我会写作");
        }
        public void Staff()
        {
            Console.WriteLine("我是高层管理员");
        }
        public void Watch()
        {
            Console.WriteLine("性别为{0}的{1}正在看着九日偷学", this.Sex, this.Name);
        }
        public void Sleep()
        {
            Console.WriteLine("性别为{0}的{1}正在睡懒觉zzz", this.Sex, this.Name);
        }
        public Programmer(string sex, string name) : base(sex, name)
        {

        }
    }
    class Program
    {
        static void TestSwin(ISwim swim)
        {
            swim.Swim();
        }

        static void TestWrite(IWrite write)
        {
            write.Write();
        }
        static void TestTeacher(ITeacher teacher)
        {
            teacher.Teach();
        }

        static void TestStaff(IStaff staff)
        {
            staff.Staff();
        }
        static void Main(string[] args)
        {
            Teacher cx = new Teacher("男","九日");
            Programmer tx = new Programmer("男","鑫哥");
            cx.Watch();
            cx.Sleep();
            TestSwin(cx);
            TestTeacher(cx);
            TestWrite(cx);
            Console.WriteLine();
            tx.Watch();
            tx.Sleep();
            TestWrite(tx);
            TestStaff(tx);
            Console.ReadKey();
        }

    }
}
